package model

import (
	"gorm.io/gorm"
	__ "shopAdd-srv/proto"
)

type Shop struct {
	gorm.Model
	Name   string
	Price  float64
	Number int
	UserId int
}

func (s *Shop) ShopAdd(db *gorm.DB) error {
	return db.Create(&s).Error
}

func (s *Shop) ShopList(db *gorm.DB) []*__.TopList {

	var shop []*__.TopList

	db.Model(s).Find(&shop)
	return shop
}
